﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EnviamentDeDocuments.ObjectesDeDades
{
    public class Client
    {
        public String Nif { get; set; }
        public String Nom { get; set; }
        public bool Valid { get; set; }
        public bool TrobatBDExpedients { get; set; }
        public String Email { get; set; }
        public String Contacte { get; set; }

        private String[] PrimeresLLetresDNI = { "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };

        public bool esEmpresa()
        { 
            if (String.IsNullOrEmpty(Nif) || PrimeresLLetresDNI.Contains(Nif.ToUpper().Substring(0,1)))
                return false;
            else
                return true;
        }

        public override string ToString()
        {
            return Nom;
        }
    }
}
